<script type="text/javascript">
    $(function() {
        var oTable1 = $('#sample-table-2').dataTable({
            "aoColumns": [
                {"bSortable": false},
                null, null, null, null,null,null,null,null,
                {"bSortable": false}
            ]});


        $('table th input:checkbox').on('click', function() {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                    .each(function() {
                this.checked = that.checked;
                $(this).closest('tr').toggleClass('selected');
            });

        });

        $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('table')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            var w2 = $source.width();

            if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2))
                return 'right';
            return 'left';
        }
    })
</script>



<div class="page-content">
    <div class="page-header position-relative">
        <h1>Cliente<small><i class="icon-double-angle-right"></i> Mantenimiento</small></h1>
    </div>

    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-header"><h4>Lista de Clientes</h4>
                    <span class="widget-toolbar">
                        <a data-action="collapse" href="#">
                            <i class="icon-chevron-up"></i>
                        </a>
                    </span>
                </div>
                <div class="widget-body">
                    <div class="widget-body-inner">
                        <div class="widget-main">
                            <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th>Nombre</th>
                                        <th>DNI</th>
                                        <th>Ocupación</th>
                                        <th>Fecha Nac.</th>
                                        <th>Lugar</th>                                  
                                        <th>Procedencia</th>
                                        <th>Razón Social</th>
                                        <th>RUC</th>
                                        <th>Dirección</th>
                                        <th>Acciones</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    //if (!empty($registros)) :
                                    if (isset($registros)) :
                                        foreach ($registros as $fila):
                                            ?>
                                            <tr class="desmarcado" style="cursor: pointer;">               
                                                <td><?php echo $fila->nombre; ?></td>
                                                <td><?php echo $fila->dni; ?></td>                        
                                                <td><?php echo $fila->ocupacion; ?></td>
                                                <td><?php echo $fila->fec_nac; ?></td>
                                                <td><?php echo $fila->lugar; ?></td>
                                                <td><?php echo $fila->procedencia; ?></td>
                                                <td><?php echo $fila->razSocial; ?></td>
                                                <td><?php echo $fila->ruc; ?></td>
                                                <td><?php echo $fila->direccion; ?></td>
                                                <td class="td-actions">
                                                    <div class="hidden-phone visible-desktop action-buttons">
                                                        <a class="blue" href="#"><i class="icon-zoom-in bigger-130"></i></a>                            
                                                        <a class="green" href="<?php echo base_url("intranet/administrador/formCliente/$fila->cod_cli"); ?>"><i class="icon-pencil bigger-130"></i></a>                            
                                                        <a class="red" href="#"><i class="icon-trash bigger-130"></i></a>   
                                                    </div>
                                                </td>
                                            </tr>
                                            <?php
                                        endforeach;
                                    endif;
                                    ?>           
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

